import { getAddress } from "@/api"

/*
 * @Author: your name
 * @Date: 2021-04-18 15:46:05
 * @LastEditTime: 2021-04-18 15:51:07
 * @LastEditors: Please set LastEditors
 * @Description: In User Settings Edit
 * @FilePath: \vue-xmll\src\store\pay.js
 */
const state = {
  address: {} // 存储用户地址
}
const mutations = {
  RESOVE_ADDRESS (state, address) {
    state.address = address
  }
}
const actions = {
  async getAddressData ({ commit }, addressId) {
    const result = await getAddress(addressId)
    if (result.code = 200) {
      commit('RESOVE_ADDRESS', result.data)
    }
  }
}
const getters = {

}
export default {
  state,
  mutations,
  actions,
  getters
}